Return to doc.sitecore.com

Transparent PNG in IE6
Prev Next

Author: Ekaterina Butenko
Posted: 12/26/2007 3:18:38 PM

Problem: When PNG images are used in Sitecore with Internet Explorer 6.0, an issue with transparency of the picture may appear.

Answer: This is a known issue with transparency in IE6 for PNG-24 images, see the following link:

http://support.microsoft.com/kb/294714

When using PNG-8 (not PNG-24) format, the transparency should work fine.

But after uploading to Sitecore and using ashx, the PNG-8 images are treated as PNG-24 images. It is not a Sitecore issue, it depends on the property System.Drawing.Imaging.ImageFormat.Png.

More details:

  1. When you upload and save the PNG-8 image, Sitecore's function Sitecore.Resources.Media.MediaConfig.GetImageFormat returns the System format of the image - System.Drawing.Imaging.ImageFormat.Png:

    More information about System.Drawing.Imaging.ImageFormat.Png can be found at the following link:

    http://msdn2.microsoft.com/en-us/library/system.drawing.imaging.imageformat.png.html

  2. The System class gets the W3C Portable Network Graphics (PNG) image format

    W3C Portable Network Graphics format:

    http://www.w3.org/Graphics/PNG/

    Second edition:

    http://www.w3.org/TR/PNG/

  3. Corresponding to the second edition the image’s format is transformed to PNG-24.

Note: IE7 does not have this issue.

The three recommended workarounds are listed here:

  1. Upgrade to IE7.
  2. Upload images as files and then use the file path of media (in order not to work with ashx).
  3. A Workaround using the AlphaImageLoader class is described at the following link:

    http://support.microsoft.com/kb/294714


Prev Next